#include "Date.h"


Date::Date(int year, int month, int day)
{
	_year = year;
	_month = month;
	_day = day;
}
//
//void Date::Print() const
//{
//	cout << _year << "-" << _month << "-" << _day << endl;
//}

bool Date::operator<(const Date& d) const
{
	if (_year < d._year)
	{
		return true;
	}
	else
	{
		if (_year == d._year)
		{
			if (_month < d._month)
			{
				return true;
			}
			else
			{
				if (_month == d._month)
				{
					return _day < d._day;
				}
			}
		}
	}
}

bool Date::operator<=(const Date& d) const
{
	return *this < d || *this == d;
}

bool Date::operator>(const Date& d)const
{
	return !(*this < d);
}

bool Date::operator>=(const Date& d)const
{
	return !(*this < d) || *this == d;
}

bool Date::operator==(const Date& d)const
{
	return _year == d._year
		&& _month == d._month
		&& _day == d._day;
}

bool Date::operator!=(const Date& d)const
{
	return !(*this == d);
}